# 设置编译最小版本
cmake_minimum_required(VERSION 3.10)

# 设置目标工程名称
project(YOLO)

# 设置生成程序名称
set(TARGET yolo)

# 设置输出程序路径
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

#--------------------------------------------------------------------------------------------------

# 添加第三方链接库
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

# 添加头文件的目录
include_directories(${PROJECT_SOURCE_DIR}/include)

# 添加链接库的目录
link_directories(${PROJECT_SOURCE_DIR}/lib)

# 添加源文件路径
aux_source_directory(${PROJECT_SOURCE_DIR}/src USRSRC)

# 生成可执行的程序
add_executable(${TARGET} ${PROJECT_SOURCE_DIR}/main.cpp ${USRSRC})

# 程序相关的链接库
target_link_libraries(${TARGET} ${OpenCV_LIBS})